package jdmx.framework.common;

import jdmx.library.utils.LexicalFactory;

public class HandlerFactory extends LexicalFactory {

	public HandlerFactory(Class<?> defaultType, String prefix, String suffix) {
		super(defaultType, prefix, suffix);
	}

	@Override
	public Handler createInstance(String handlingCode, String namespace) {
		return createInstance(handlingCode, namespace, null);
	}
	
	@Override
	public Handler createInstance(String handlingCode, String namespace, Class<?> defaultType) {
		Handler handler = (Handler) super.createInstance(handlingCode, namespace, defaultType);
		handler.init(handlingCode);
		return handler;
	}	
}
